#include <stdio.h>

namespace CXX_CAST_OBJ_PTR_TO_OBJ_PTR {
	namespace bad {
		void f(void)
		{
			if (sizeof(int) == sizeof(float)) {
				float f = 0.0f;
				int* ip = (int*)&f;
				(*ip)++;
				printf("float is %f\n", f);
				int i = 0;
				ip = (int*)&i;

			}
		}
		int main(int argc, char* argv[])
		{
			f();
			return 0;
		}


	}


	namespace good {

		void f(void)
		{
			if (sizeof(int) == sizeof(float)) {
				float f = 0.0f;
				float* ip = &f;
				(*ip)++;
				printf("float is %f\n", f);
				int i = 0;

			}
		}
		int main(int argc, char* argv[])
		{
			f();
			return 0;
		}
	}
}